import { createSlice } from "@reduxjs/toolkit";

const countSlice = createSlice({
  name: "counter",
  initialState: {
    value: 0,
  },
  reducers: {
    createPlusAction: (state, action) => {
      state.value += action.payload;
    },
    createMinusAction: (state, action) => {
      state.value -= action.payload;
    },
  },
});

export const { createPlusAction, createMinusAction } = countSlice.actions;

export default countSlice.reducer